//==========================================================================
// Copyright (c) 2000-2008,  Elastos, Inc.  All Rights Reserved.
//==========================================================================

#ifndef __CHANNEL_DATA_H__
#define __CHANNEL_DATA_H__

#include "ChannelPackage.h"

class ChannelData : public ChannelPackage
{
protected:
    char* m_data;
    unsigned int m_dataSize;

public:
    ChannelData();
    ChannelData(const ChannelData& data);
    ChannelData(unsigned int channelNumber,
            char* data, unsigned int dataSize);
    virtual ~ChannelData();

    inline unsigned int GetDataSize() const
    {
        return m_dataSize;
    }
    inline void SetDataSize(unsigned int dataSize)
    {
        m_dataSize = dataSize;
    }
    inline char* GetData() const
    {
        return m_data;
    }
    // No SetData?

    virtual unsigned int GetPackageSize();
    virtual void WriteBuffer(char* buffer);
    virtual int Read(ReadInputStream is);
};

#endif //__CHANNEL_DATA_H__
